package com.shutong.edu.invoke.retry.processor;

import com.shutong.edu.invoke.retry.model.RetryInfo;
import net.sf.cglib.proxy.MethodProxy;

/**
 *
 * @ClassName: CglibRetryProcessor.java
 * @author: Naughty Guo
 * @date: Jun 2, 2016
 */
public class CglibRetryProcessor extends AbstractRetryProcessor {

    @Override
    protected Object doInvoke(RetryInfo retryInfo) throws Throwable {
        MethodProxy methodProxy = retryInfo.getMethodProxy();
        Object targetObject = retryInfo.getTargetProxyObject();
        return methodProxy.invokeSuper(targetObject, retryInfo.getArguments());
    }
}